#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->lineEdit->setEchoMode(QLineEdit::Password);
    ui->lineEdit_2->setEchoMode(QLineEdit::Password);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_lineEdit_textEdited(const QString &arg1)
{
   QString s=ui->lineEdit->text();
   QString a=ui->lineEdit_2->text();
   if(s==""&&a=="")
   {
       ui->label_3->setText("密码为空");
   }
   else if(s==a)
   {
       ui->label_3->setText("密码相等");
   }
   else
   {
       ui->label_3->setText("密码不相等");
   }
}

void Widget::on_lineEdit_2_textEdited(const QString &arg1)
{
    QString s=ui->lineEdit->text();
    QString a=ui->lineEdit_2->text();
    if(s==""&&a=="")
    {
        ui->label_3->setText("密码为空");
    }
    else if(s==a)
    {
        ui->label_3->setText("密码相等");
    }
    else
    {
        ui->label_3->setText("密码不相等");
    }
}
